package com.heima.feigns;

import com.heima.config.HeimaFeignAutoConfiguration;
import com.heima.feigns.fallback.AdminFeignFallback;
import com.heima.model.admin.pojos.AdChannel;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.nio.channels.Channel;
import java.util.List;

@FeignClient(value = "leadnews-admin",
            configuration = HeimaFeignAutoConfiguration.class,
            fallbackFactory = AdminFeignFallback.class
)
public interface AdminFeign {
    // 查询敏感词内容列表
    @PostMapping("/api/v1/sensitive/sensitives")
    public ResponseResult<List<String>> sensitives();

    /**
     * 根据id查询频道
     * @param id
     * @return
     */
    @GetMapping("api/v1/channel/one/{id}")
    public ResponseResult<AdChannel> findById(@PathVariable("id") Integer id);


}
